package com.xiaowei.application.rest;

import com.xiaowei.service1.api.ConsumerService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 应用层
 * application 对外暴露的接口
 */
@RestController
@RequestMapping("/service")
public class ApplicationController {

    // 注入 service 基于 Dubbo 协议
    @org.apache.dubbo.config.annotation.Reference
    private ConsumerService consumerService;

    @GetMapping
    String service(){
        String target = consumerService.service();
        return "application-1 |test| " + target;
    }
}
